// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

export async function getCaptcha(checkKey: number) {
  console.log("get captcha============="+`/wmsServer/sys/randomImage/${checkKey}`)
  return request<API.BaseResult>(`/wmsServer/sys/randomImage/${checkKey}`, {
    method: 'GET'
  });
}

/** 登录接口 POST /api/login/account */
export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
  return request<API.BaseResult>('/wmsServer/sys/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 退出登录接口 POST /api/login/outLogin */
export async function outLogin(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/wmsServer/sys/logout', {
    method: 'POST',
    ...(options || {}),
  });
}


export async function getPermCode(token:string) {
  return request(`/wmsServer/sys/permission/getUserPermissionByToken`, {
    method: 'GET',
    params:{
      token:token
    }
  });
}
